<?php
$query_feature = "SELECT apartment.id, image, name, neighborhood, num_bedrooms, ROUND(num_bathrooms) AS num_bathrooms, price, apt_type, building_id
FROM apartment, featured_units, building, neighborhood
WHERE apartment.building_id = building.id AND building.neighborhood_id = neighborhood.id AND apartment.id = featured_units.apt_id AND apt_type = 'rental' ORDER BY price ASC";

$query_priceMinMax = "SELECT Min(apartment.price) AS minPrice, Max(apartment.price) AS maxPrice FROM apartment WHERE apartment.availability =  '1' AND apartment.apt_type =  'rental'";

$query_bedroomsMinMax = "SELECT Min(num_bedrooms) AS minbedrooms, Max(num_bedrooms) AS maxbedrooms FROM apartment WHERE apartment.availability =  '1' AND apt_type = 'rental'";

$query_bathroomsMinMax = "SELECT Min(num_bathrooms) AS minbathrooms, Max(num_bathrooms) AS maxbathrooms FROM apartment WHERE apartment.availability =  '1' AND apt_type = 'rental'";

$query_building = "SELECT building.id, building.type2, building.name, building.address, building.neighborhood_id FROM building WHERE building.type = 'Residential' ORDER BY building.address ASC";

$query_amenities = "SELECT id,amenity FROM amenity";

$query_square = "SELECT Min(square_feet) AS minsquare, Max(square_feet) AS maxsquare FROM apartment WHERE apartment.availability = '1' AND apt_type = 'rental'";

$query_neighborhood = "SELECT DISTINCT neighborhood.neighborhood, neighborhood.id 
FROM apartment Inner Join building ON building.id = apartment.building_id Inner Join neighborhood ON neighborhood.id = building.neighborhood_id 
WHERE apartment.availability =  '1' AND apartment.apt_type =  'rental'";

?>